/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JDialogPathology.java
 *
 * Created on 06/05/2010, 18:47:16
 */
package systole.view.crud.pathology;

import javax.swing.JTextArea;
import javax.swing.JTextField;
import org.jdesktop.application.Action;

/**
 *
 * @author jmj
 */
public class JDialogPathology extends javax.swing.JDialog {

    /**
     *
     */
    private static final long serialVersionUID = 2368558679250516945L;
    private ControllerPathologyEdition controllerPathologyEdition;

    /** Creates new form JDialogPathology
     * @param parent 
     * @param controllerPathologyEdition
     */
    public JDialogPathology(java.awt.Frame parent, ControllerPathologyEdition controllerPathologyEdition) {
        super(parent, true);
        initComponents();
        this.controllerPathologyEdition = controllerPathologyEdition;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPnlCenter = new javax.swing.JPanel();
        jEdtName = new javax.swing.JTextField();
        jEdtInitials = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTxtDescription = new javax.swing.JTextArea();
        jLblName = new javax.swing.JLabel();
        jLblInitials = new javax.swing.JLabel();
        jLblDescription = new javax.swing.JLabel();
        jPnlBottom = new javax.swing.JPanel();
        jBtnOk = new javax.swing.JButton();
        jBtnCancel = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setName("Form"); // NOI18N
        setResizable(false);

        jPnlCenter.setName("jPnlCenter"); // NOI18N
        jPnlCenter.setPreferredSize(new java.awt.Dimension(340, 157));

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(systole.view.SystoleApp.class).getContext().getResourceMap(JDialogPathology.class);
        jEdtName.setText(resourceMap.getString("jEdtName.text")); // NOI18N
        jEdtName.setName("jEdtName"); // NOI18N

        jEdtInitials.setText(resourceMap.getString("jEdtInitials.text")); // NOI18N
        jEdtInitials.setName("jEdtInitials"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jTxtDescription.setColumns(20);
        jTxtDescription.setFont(jTxtDescription.getFont());
        jTxtDescription.setLineWrap(true);
        jTxtDescription.setRows(4);
        jTxtDescription.setToolTipText(resourceMap.getString("jTxtDescription.toolTipText")); // NOI18N
        jTxtDescription.setWrapStyleWord(true);
        jTxtDescription.setName("jTxtDescription"); // NOI18N
        jScrollPane1.setViewportView(jTxtDescription);

        jLblName.setFont(jLblName.getFont().deriveFont(jLblName.getFont().getStyle() | java.awt.Font.BOLD));
        jLblName.setText(resourceMap.getString("jLblName.text")); // NOI18N
        jLblName.setName("jLblName"); // NOI18N

        jLblInitials.setText(resourceMap.getString("jLblInitials.text")); // NOI18N
        jLblInitials.setName("jLblInitials"); // NOI18N

        jLblDescription.setText(resourceMap.getString("jLblDescription.text")); // NOI18N
        jLblDescription.setName("jLblDescription"); // NOI18N

        javax.swing.GroupLayout jPnlCenterLayout = new javax.swing.GroupLayout(jPnlCenter);
        jPnlCenter.setLayout(jPnlCenterLayout);
        jPnlCenterLayout.setHorizontalGroup(
            jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPnlCenterLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLblName, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLblInitials, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLblDescription, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 287, Short.MAX_VALUE)
                    .addComponent(jEdtName, javax.swing.GroupLayout.DEFAULT_SIZE, 287, Short.MAX_VALUE)
                    .addComponent(jEdtInitials, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPnlCenterLayout.setVerticalGroup(
            jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPnlCenterLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jEdtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLblName))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jLblInitials)
                    .addComponent(jEdtInitials, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLblDescription)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(27, 27, 27))
        );

        getContentPane().add(jPnlCenter, java.awt.BorderLayout.CENTER);

        jPnlBottom.setName("jPnlBottom"); // NOI18N
        jPnlBottom.setPreferredSize(new java.awt.Dimension(174, 40));

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(systole.view.SystoleApp.class).getContext().getActionMap(JDialogPathology.class, this);
        jBtnOk.setAction(actionMap.get("confirm")); // NOI18N
        jBtnOk.setText(resourceMap.getString("jBtnOk.text")); // NOI18N
        jBtnOk.setToolTipText(resourceMap.getString("jBtnOk.toolTipText")); // NOI18N
        jBtnOk.setName("jBtnOk"); // NOI18N
        jPnlBottom.add(jBtnOk);

        jBtnCancel.setAction(actionMap.get("cancel")); // NOI18N
        jBtnCancel.setText(resourceMap.getString("jBtnCancel.text")); // NOI18N
        jBtnCancel.setToolTipText(resourceMap.getString("jBtnCancel.toolTipText")); // NOI18N
        jBtnCancel.setName("jBtnCancel"); // NOI18N
        jPnlBottom.add(jBtnCancel);

        getContentPane().add(jPnlBottom, java.awt.BorderLayout.SOUTH);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * Confirm changes
     */
    @Action
    public void confirm() {
        this.controllerPathologyEdition.ok();
    }

    /**
     * Cancel changes
     */
    @Action
    public void cancel() {
        this.controllerPathologyEdition.cancel();
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBtnCancel;
    private javax.swing.JButton jBtnOk;
    private javax.swing.JTextField jEdtInitials;
    private javax.swing.JTextField jEdtName;
    private javax.swing.JLabel jLblDescription;
    private javax.swing.JLabel jLblInitials;
    private javax.swing.JLabel jLblName;
    private javax.swing.JPanel jPnlBottom;
    private javax.swing.JPanel jPnlCenter;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea jTxtDescription;
    // End of variables declaration//GEN-END:variables

    /**
     * @return initials edit 
     */
    public JTextField getjEdtInitials() {
        return jEdtInitials;
    }

    /**
     * @return name edit
     */
    public JTextField getjEdtName() {
        return jEdtName;
    }

    /**
     * @return description edit
     */
    public JTextArea getjTxtDescription() {
        return jTxtDescription;
    }
}
